package il.technion.math.wlfuModel;
import il.technion.math.zipfdistribution.EfficentZipfDistribution;

//import org.apache.commons.math3.distribution.BinomialDistribution;;
//import org.apache.commons.math3.distribution.NormalDistribution;

public class wlfuPredictor {
	public static double predict(double WindowSize, int elements, double c)
	{
		return 0.0;
//		NormalDistribution n = new NormalDistribution();
//		double hitrate =0.0;
//		double x = 0;
//		double sum =0;
//		double mone;
//		double mechane;
//		double densitiyResult;
//		double alpha = 0.9;
//		double Sigma = 0;
//		double perfectHitrate = 0;
//		EfficentZipfDistribution ezd = new EfficentZipfDistribution(alpha, elements, 0);
//		Sigma = ezd.getSum();
//		//System.out.println(Sigma);
//		for(int i =1; i<2*c; i++)
//		{
//			x = i;
//			mone =  WindowSize*(Math.pow((1.0/c),alpha)- Math.pow((1.0/x),alpha));
//		
//			mechane = Math.sqrt(WindowSize*Math.pow((1/x),alpha)*(1-(Math.pow((1/(x)),alpha)/Sigma))*Sigma);
//			densitiyResult = (1-n.cumulativeProbability(mone/mechane));
//			
//			
//			if(densitiyResult == Double.NaN)
//			{
//				System.err.println("**********"+ i);
//				continue;
//			}
//			
//			
//			sum+=densitiyResult;
//			hitrate +=(1/(Math.pow(x, alpha)*Sigma))*densitiyResult;
//			perfectHitrate +=(1/(Math.pow(x, alpha)*Sigma));
//			//System.out.println(i+" " + densitiyResult+" "+perfectHitrate);
//		}
//		double phitrate=0;
//		System.out.println(sum);
//		for(int i =0;i<sum; i++)
//		{
//			phitrate +=(1/(Math.pow(i+1.0, alpha)*Sigma)); 
//		}
//		return hitrate/phitrate;   
	}

	
	 public static void main(String [ ] args)
	 {
		for(int windowSize =10000; windowSize<20000;windowSize+=10000 )
		 System.out.println(windowSize+" "+ predict(windowSize,1000000,10000));
		 
		 
	 }
}
